home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13171 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: solon.com!not-for-mail
  2. From: schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
  4. Subject: Re: C coding problem
  5. Date: 4 Apr 1996 18:29:36 -0600
  6. Organization: TU Wien
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4k1phg$4sv@solutions.solon.com>
  10. References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com> <4j41ru$nq4@solutions.solon.com> <4jttlq$3p1@solutions.solon.com> <4jv77f$cu8@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12.  
  13. In article <4jv77f$cu8@solutions.solon.com>, ferguson@col.hp.com (Scott Ferguson) writes:
  14. |> I would hope by now that HP's C compiler has a fairly good degree of 
  15. |> optimization built in, to the point that most cases of this:
  16.  
  17. [pointer addressing vs. array indexing]
  18.  
  19. |> In my former life, I worked on supercomputers, and the ONLY way to get
  20. |> decent performance out of C code was to use arrays whenever possible, 
  21. |> otherwise the compiler which was built to maximize use of available 
  22. |> hardware acceleration could tell what you were trying to do. So where
  23. |> do our compilers stand on this? If PA-RISC has some superscalar ops like
  24. |> multiply-add in a single clock, I'd rather give the compiler enough high-level
  25. |> language to optimize to what's best for the hardware.
  26.  
  27. As a matter of fact, HP-UX comes with a large library of vector subroutines,
  28. supposedly hand-tuned for speed.  The Fortran compiler has a source-to-source
  29. transformer that tries to find loops that can be replaced with calls to the
  30. library.
  31.  
  32. I think this is the way to go if you want high performance vector computing.
  33. Use BLAS or Fortran-90 vector constructs.  Optimizers have a long way to go
  34. before they are as smart as humans.
  35.  
  36. Konrad Schwarz
  37.